package com.bosssoft.springboot.demo3.config;


import com.bosssoft.springboot.demo3.client.GetMobileInfoClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.oxm.jaxb.Jaxb2Marshaller;

/**
 * @author ChenTong
 * @version 1.0
 * @description webService配置调用天气预报查询
 * @date 2020/6/13 7:38
 * @modified
 **/
@Configuration
public class GetMobileInfoConfig {
    @Bean
    public Jaxb2Marshaller marshaller(){
        Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
        marshaller.setContextPath("com.bosssoft.springboot.consumingwebservice.wsdl");
        return marshaller;
    }

    @Bean
    public GetMobileInfoClient mobileInfoClient(Jaxb2Marshaller marshaller){
        GetMobileInfoClient client = new GetMobileInfoClient();
        client.setDefaultUri("http://WebXml.com.cn");
        client.setMarshaller(marshaller);
        client.setUnmarshaller(marshaller);
        return client;
    }


}
